<{include file="section/admin/header2.tpl"}>

<script type="text/javascript" src="<{$smarty.const._DOMAIN_SC_CDN_}>/upload/zx/sc/js/highslide/highslide-with-html.js"></script>
<link rel="stylesheet" type="text/css" href="<{$smarty.const._DOMAIN_SC_CDN_}>/upload/zx/sc/js/highslide/highslide.css" />
<script type="text/javascript">
hs.graphicsDir = '<{$smarty.const._DOMAIN_SC_CDN_}>/upload/zx/sc/js/highslide/graphics/';
hs.outlineType = 'rounded-white';
hs.wrapperClassName = 'draggable-header';
</script>

<div class="box02" style="width:1000px;">
	<div class="box02_1" style="width:1000px;">
		<div class="search02 clear" >
			<form action="/audit/" method="get" name="frm" id="frm">
				<table cellpadding="0" cellspacing="0" width="100%" border="0" >
					<tr>
						<td>
							<div class="select">
								<span style="width:100px;">
									<select name="query" id="query" onchange="change_query(this.value);">
										<option <{if $current_query=='all'}>selected<{/if}> value="all">全部</option>
										<option <{if $current_query=='close'}>selected<{/if}> value="close">已关闭</option>
									</select>
								</span>
							</div>
						</td>
						<td width="60%"></td>
						<td  align="right">
							<div class="find">
								<input type="text" align="right"  name="search" id="search" width="100px" value="<{$shop_name}>">
								<input type="submit" align="right"  class="btn04" value="搜　索" >
							</div>
						</td>
					</tr>
				</table>
			</form>
		</div>        
		<div class="line1" style="width:1000px;"></div>
		<div class="table01">
			<table  cellpadding="0" cellspacing="0" width="100%" border="0" id="table" style="word-wrap:break-word;table-layout:fixed;overflow:hidden;text-overflow:ellipsis;">
				<tr class="th">
					<th style="width:130px;"><div >店铺名称</div></th>
					<th style="width:100px;"><div >区域</div></th>
					<th style="width:100px;"><div >详细地址</div></th>
					<th style="width:100px;"><div >主营行业</div></th>
					<th style="width:100px;"><div >品牌</div></th>
					<th style="width:70px;"><div >联系人</div></th>
					<th style="width:100px;"><div >电话</div></th>
					<th style="width:140px;"><div >帐号</div></th>
					<th style="width:100px;"><div >申请时间</div></th>
					<th style="width:60px;"><div >操作</div></th>		
				</tr>
				<{foreach from=$shops item=shop }>
					<tr class="bg">
						<td class="tl"><div><a href="<{$shop.shop_url}>" target="_blank"><{$shop.shop_name}></a></div></td>
						<td><div><{$shop.location}></div></td>
						<td class="tl"><div><{$shop.address}></div></td>
						<td class="tl"><div><{$shop.major_category_name}></div></td>
						<td><div><{$shop.brand}></div></td>
						<td><div><{$shop.name}></div></td>
						<td class="tl"><div><{$shop.mobile}></div></td>
						<td class="tl"><div><{$shop.passport}></div></td>
						<td><div><{$shop.apply_time}></div></td>
						<td ><div>
							<{if $shop.open_status eq "open"}>
							<a href="" onclick="return hs.htmlExpand(this)">关闭</a>
								<div class="highslide-maincontent">
									<form id="reason_frm_<{$log.id}>"  name="reason_frm_<{$log.id}>" method="post">
										<table cellpadding="0" cellspacing="0" width="100%" border="0"  style="word-wrap:break-word;table-layout:fixed;overflow:hidden;text-overflow:ellipsis;">
										<tr><td style="width:80px;">店铺名称：</td><td align="left"><{$shop.name}></td></tr>
										<tr><td style="width:80px;"><span class="red">*</span>关闭原因：</td>
										<td align="left"><select name="reason_<{$shop.id}>" id="reason_<{$shop.id}>" >					    		
											<{foreach from=$close_reasons item=reason key=reason_key}>
												<option  value="<{$reason_key}>"><{$reason.name}></option>
											<{/foreach}>
										</select></td>
										<tr ><td colspan="2" align="center"><input type="button" name="onsubmit" value="提交" onclick="confirm_close(<{$shop.id}>)"/></td></tr>
										</table>							
									</form>
								</div> 
							<{elseif $shop.open_status eq "close"}>
							<a href="/audit/reopen/<{$shop.id}>?query=<{$current_query}>&search=<{$shop_name}>">恢复</a>
							<{/if}>&nbsp;
						</div></td>
					</tr>
				<{/foreach}>
				
			</table>
		</div>
		<div class="page clear">
		共计：<{$pagecount}>
		<{$pagination}>
		</div>
	</div>
</div>	
<script type="text/javascript">

function change_query(query)
{
   var url = "/audit?query="+query;
   window.location = url;
}
function confirm_close(shop_id)
{
	var reason = document.getElementById("reason_" + shop_id);	
	var query = document.getElementById("query");		
	var search = document.getElementById("search");		
    if( ! reason) return false;
    if( ! query) return false;
    if( ! search) return false;
    
	var reason_value	= reason.value;
	if(!reason_value)
	{
		alert("关闭原因不能为空！");
		return false;
	}
	var query_value	= query.value;
	var search_value	= search.value;
	var url = "/audit/close/"+shop_id+"/"+reason_value+"?query="+query_value+"&search="+search_value;
	window.location = url;
	
}
</script>
<{include file="section/admin/footer2.tpl"}>
